package windows;

import java.lang.reflect.Field;
import java.util.Collection;

public class Controller {
	
	public Controller(Object object){
		
		if(gotCollections(object))
			new Window(object, this);
		else
			new ObjectWindow(object, this);
	}
	
	public boolean gotCollections(Object object){
		Class<?> c = object.getClass();
		for (Field field : c.getDeclaredFields()) {
			if(Collection.class.isAssignableFrom(field.getType())){
				return true;
			}
		}
		return false;
	}
}